import {reqPayInfo} from '@/api/index'
const state={
    payInfo:{}
}
const mutations={
    RECEIVE_PAYINFO(state,payInfo){
        state.payInfo=payInfo
    }
}
const actions={
    async getPayInfoList({commit},orderId){
        const payInfoList=await reqPayInfo(orderId)
        if(payInfoList.code===200){
            // console.log(payInfoList.data)
            commit('RECEIVE_PAYINFO',payInfoList.data.result)
        }
    }
}
const getters={
  addressInfo(state){
      
      return state.payInfo.addressInfo ||{}
  },
  goodsList(state){
     
      return state.payInfo.goodsList || []
  }
}

export default{
   state,
   mutations,
   actions,
   getters,
}